package com.wwwzh.himalayafm.fragment.subfragment;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;

import java.util.ArrayList;
import java.util.List;

public class SubViewPagerAdapter extends FragmentPagerAdapter {
    private List<String> listTitles = new ArrayList();

    public SubViewPagerAdapter(FragmentManager paramFragmentManager) {
        super(paramFragmentManager);
        this.listTitles.add("推荐");
        this.listTitles.add("订阅");
        this.listTitles.add("历史");
    }
    @Override
    public int getCount() {
        return this.listTitles.size();
    }
    @Override
    public Fragment getItem(int paramInt) {
        Fragment fragment = null;
        switch (paramInt) {
            case 0:
                fragment  = new SubRecFragment();
                break;
            case 1:
                fragment =  SubSubFragment.newInstance(0);
                break;
            case 2:
                fragment =  SubHistoryFragment.newInstance(0);
                break;
        }
        return fragment;
    }
    @Override
    public CharSequence getPageTitle(int paramInt) {
        return (CharSequence) this.listTitles.get(paramInt);
    }
}

